package Jcat.cduestcbbs.Service;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import Jcat.cduestcbbs.Dao.ReplyDao;
import Jcat.cduestcbbs.DaoImpl.ReplyDaoImpl;
import Jcat.cduestcbbs.Po.ReplyPo;
import Jcat.cduestcbbs.tools.PagePo;

public class ReplyPagingService {
	ReplyDao replysdaoImpl = new ReplyDaoImpl();

	public List<ReplyPo> getAllReplys(PagePo page, int replys_allsticks_id)
			throws SQLException {
		List<ReplyPo> list = new ArrayList<ReplyPo>();
		try {
			list = replysdaoImpl.getAllReplys(page, replys_allsticks_id);
		} catch (SQLException e) {
			throw e;
		}
		return list;
	}

	public int getAllReplysCount(int replys_posts_id) throws SQLException {
		int count = 0;
		try {
			count = replysdaoImpl.getAllReplysCount(replys_posts_id);
		} catch (SQLException e) {
			throw e;
		}
		return count;
	}

	public Map<Integer, Integer> getPostsPagingMap() {
		Map pagingMap = null;
		try {
			pagingMap = replysdaoImpl.getPostsPagingMap();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return pagingMap;
	}
}
